package cn.xluobo.business.wechat.miniapp.base.controller;

import cn.xluobo.business.wechat.miniapp.base.domain.resp.RespBindUserDetailInfo;
import cn.xluobo.business.wechat.miniapp.base.domain.resp.RespBindUserInfo;
import cn.xluobo.business.wechat.miniapp.base.service.WechatMiniUserService;
import cn.xluobo.core.api.APIResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户
 * @author ：KingLong
 * @date ：Created in 2020/10/22 08:55
 */
@RestController
@RequestMapping("/api/wechat/miniapp/{appId}/base")
public class WechatMiniUserController {

    @Autowired
    private WechatMiniUserService wechatMiniUserService;

    /**
     * 获取绑定用户信息
     * @return
     */
    @GetMapping("/getBindUserInfo")
    public APIResponse getBindUserInfo() {
        RespBindUserInfo bindUserInfo = wechatMiniUserService.getBindUserInfo();
        return APIResponse.toAPIResponse(bindUserInfo);
    }

    /**
     * 详细信息
     * @return
     */
    @GetMapping("/getBindUserDetailInfo")
    public APIResponse getBindUserDetailInfo() {
        RespBindUserDetailInfo bindUserDetailInfo = wechatMiniUserService.getBindUserDetailInfo();
        return APIResponse.toAPIResponse(bindUserDetailInfo);
    }
}
